(
TempoClock.default.tempo = 84/60;
p = Pbind(\scale, #[0, 2, 3, 5, 7, 8, 10],\root, 2,\degree, Pseq(#[rest, 4, 3, 4, 2, 4, 1, 4, 0, 4, -0.9, 4, 0, 4, 1, 4, 2, 4,-3, 4, -1.9, 4, -0.9, 4, 0, 4, -0.9, 4, 0, 4, 1, 4, 2], 1),\dur, 0.25).play;
)

(
p = Pbind(\scale, #[0, 2, 3, 5, 7, 8, 10],\root, 2,\degree, Place([#[rest, 3, 2, 1, 0, -0.9, 0, 1, 2, -3, -1.9, -0.9, 0, -0.9, 0, 1, 2],(4 ! 16) ++ \rest], 17),\dur, 0.25).play;
)

(
p = Pbind(\scale, #[0, 2, 3, 5, 7, 8, 10],\root, 2,\degree, Ppatlace([Pseq(#[rest, 3, 2, 1, 0, -0.9, 0, 1, 2, -3, -1.9, -0.9, 0, -0.9, 0, 1, 2], 1),Pn(4, 16)], inf),\dur, 0.25).play;
)

{SinOsc.ar([448,773],0,1)}.scope

{FSinOsc.ar(#[440,880,1320], 0.0, [1,0.75,0.5])}.play;

	(
	s.waitForBoot({
		SynthDef("test", { arg out, freq=330, amp=0.6;
			Out.ar(out, SinOsc.ar(freq,0,amp))
		}).add;
		
	
		SynthDescLib.global.at(\test).makeWindow;
	});
	)
	
{ VOsc3.ar(MouseX.kr(80,87), 120, 121.04, 119.37, 0.2) }.scope(1, zoom:4);	

{ SinOsc.ar(XLine.kr(5000,40,16), 14, 0.2) }.scope;
{ Klang.ar(`[[100,200,400], nil, nil ], 0.3, 0) }.scope(1);

{ Klang.ar(`[[Array.rand(2, 200.0, 2000.0).postln],0.001,nil],0.3,0)}.scope(1)


(
{
loop({
	play({
		Pan2.ar(Klang.ar(`[ Array.rand(12, 200.0, 2000.0), nil, nil ], 1, 0), 1.0.rand) 
			* EnvGen.kr(Env.sine(4), 1, 0.02, doneAction: 2);
	});
	2.wait;
})
}.fork;
)

(
s.waitForBoot({
	a={arg mod=0.05, index=0.05, f=440, p=660, b=4;
			var r,out,out2;
			r=Saw.ar(b,0.03).scope;
			out=PMOsc.ar(f,
				660*mod,3*index, 0,
				Lag.ar(r,0.01,1));
			[out];//,Delay1.ar(out)];

			}.scope(zoom: 4);

	w = Window("Slider2D", Rect(100,Window.screenBounds.height-400, 300 ,300));
	w.view.decorator = FlowLayout(w.view.bounds);
	t = Slider2D(w, Rect(0, 0,100, 100))
			.y_(0.05)
			.x_(0.05)
			.action_({|sl|
				a.set(\mod,sl.x,\index,sl.y);
			});
	u = Slider2D(w, Rect(0, 0,100, 100))
			.y_(4000)
			.x_(0)
			.action_({|sl|
				a.set(\f,sl.x*4000,\b,sl.y*20);
			});				
	w.front;
	CmdPeriod.doOnce({w.close});
})
)

	
	// Shape a Sound
(
s.waitForBoot({
	a={arg mod=0.05, index=0.05, f=440, p=660, b=4;
			var r,out,out2;
			r=Saw.ar(b,0.03).scope;
			out=PMOsc.ar(f,
				660*mod,3*index, 0,
				Lag.ar(r,0.01,1));
			[out];//,Delay1.ar(out)];

			}.scope(zoom: 4);

	w = Window("Slider2D", Rect(100,Window.screenBounds.height-400, 300 ,300));
	w.view.decorator = FlowLayout(w.view.bounds);
	t = Slider2D(w, Rect(0, 0,100, 100))
			.y_(0.05)
			.x_(0.05)
			.action_({|sl|
				a.set(\mod,sl.x,\index,sl.y);
			});
	u = Slider2D(w, Rect(0, 0,100, 100))
			.y_(4000)
			.x_(0)
			.action_({|sl|
				a.set(\f,sl.x*4000,\b,sl.y*20);
			});				
	w.front;
	CmdPeriod.doOnce({w.close});
})
)

play({ PMOsc.ar(300, 550, Line.ar(0,20,8), 0, 0.1) });